2000W / 48V LLC Battery-Charger  V1.00
xmc_scu.h
Go to the documentation of this file.
1 
62 #ifndef XMC_SCU_H
63 #define XMC_SCU_H
64 
65 /*********************************************************************************************************************
66  * HEADER FILES
67  ********************************************************************************************************************/
68 #include <xmc_common.h>
69 
160 /*********************************************************************************************************************
161  * MACROS
162  ********************************************************************************************************************/
163 
164 /*********************************************************************************************************************
165  * ENUMS
166  ********************************************************************************************************************/
170 typedef enum XMC_SCU_STATUS
171 {
178 
179 
180 /*********************************************************************************************************************
181  * DATA TYPES
182  ********************************************************************************************************************/
183 
187 typedef void (*XMC_SCU_INTERRUPT_EVENT_HANDLER_t)(void);
188 
189 /*********************************************************************************************************************
190  * DEVICE EXTENSIONS
191  ********************************************************************************************************************/
192 
193 #if (UC_FAMILY == XMC1)
194 #include <xmc1_scu.h>
195 #elif (UC_FAMILY == XMC4)
196 #include <xmc4_scu.h>
197 #else
198 #error "Unspecified chipset"
199 #endif
200 
201 /*********************************************************************************************************************
202  * API Prototypes
203  ********************************************************************************************************************/
204 
205 #ifdef __cplusplus
206 extern "C" {
207 #endif
208 
209 
230 __STATIC_INLINE void XMC_SCU_SetCcuTriggerHigh(const uint32_t trigger)
231 {
232  SCU_GENERAL->CCUCON |= (uint32_t)trigger;
233 }
234 
255 __STATIC_INLINE void XMC_SCU_SetCcuTriggerLow(const uint32_t trigger)
256 {
257  SCU_GENERAL->CCUCON &= (uint32_t)~trigger;
258 }
259 
290 void XMC_SCU_CLOCK_Init(const XMC_SCU_CLOCK_CONFIG_t *const config);
291 
307 void XMC_SCU_INTERRUPT_EnableEvent(const XMC_SCU_INTERRUPT_EVENT_t event);
308 
309 
323 void XMC_SCU_INTERRUPT_DisableEvent(const XMC_SCU_INTERRUPT_EVENT_t event);
324 
339 void XMC_SCU_INTERRUPT_TriggerEvent(const XMC_SCU_INTERRUPT_EVENT_t event);
340 
354 XMC_SCU_INTERRUPT_EVENT_t XMC_SCU_INTERUPT_GetEventStatus(void);
355 
372 void XMC_SCU_INTERRUPT_ClearEventStatus(const XMC_SCU_INTERRUPT_EVENT_t event);
373 
392 {
393  return ((SCU_RESET->RSTSTAT) & SCU_RESET_RSTSTAT_RSTSTAT_Msk);
394 }
407 {
408  /* Clear RSTSTAT.RSTSTAT bitfield */
409  SCU_RESET->RSTCLR = (uint32_t)SCU_RESET_RSTCLR_RSCLR_Msk;
410 }
411 
426 {
427  return SystemCoreClock;
428 }
429 
440 
441 #if(UC_SERIES != XMC45)
442 
472 void XMC_SCU_CLOCK_GatePeripheralClock(const XMC_SCU_PERIPHERAL_CLOCK_t peripheral);
473 
500 void XMC_SCU_CLOCK_UngatePeripheralClock(const XMC_SCU_PERIPHERAL_CLOCK_t peripheral);
501 
524 bool XMC_SCU_CLOCK_IsPeripheralClockGated(const XMC_SCU_PERIPHERAL_CLOCK_t peripheral);
525 #endif
526 
527 
544 {
545  return(SCU_GENERAL->MIRRSTS);
546 }
547 
568 XMC_SCU_STATUS_t XMC_SCU_INTERRUPT_SetEventHandler(const XMC_SCU_INTERRUPT_EVENT_t event, const XMC_SCU_INTERRUPT_EVENT_HANDLER_t handler);
569 
584 void XMC_SCU_IRQHandler(uint32_t sr_num);
585 
586 #ifdef __cplusplus
587 }
588 #endif
589 
598 #endif /* SCU_H */
void(* XMC_SCU_INTERRUPT_EVENT_HANDLER_t)(void)
Definition: xmc_scu.h:187
void XMC_SCU_INTERRUPT_DisableEvent(const XMC_SCU_INTERRUPT_EVENT_t event)
Definition: xmc1_scu.c:367
uint32_t XMC_SCU_CLOCK_GetPeripheralClockFrequency(void)
Definition: xmc1_scu.c:792
enum XMC_SCU_STATUS XMC_SCU_STATUS_t
__STATIC_INLINE void XMC_SCU_RESET_ClearDeviceResetReason(void)
Definition: xmc_scu.h:406
__STATIC_INLINE uint32_t XMC_SCU_CLOCK_GetCpuClockFrequency(void)
Definition: xmc_scu.h:425
void XMC_SCU_CLOCK_UngatePeripheralClock(const XMC_SCU_PERIPHERAL_CLOCK_t peripheral)
Definition: xmc1_scu.c:636
#define SCU_RESET_RSTCLR_RSCLR_Msk
Definition: XMC1400.h:4612
bool XMC_SCU_CLOCK_IsPeripheralClockGated(const XMC_SCU_PERIPHERAL_CLOCK_t peripheral)
Definition: xmc1_scu.c:648
void XMC_SCU_INTERRUPT_TriggerEvent(const XMC_SCU_INTERRUPT_EVENT_t event)
Definition: xmc1_scu.c:376
__STATIC_INLINE void XMC_SCU_SetCcuTriggerLow(const uint32_t trigger)
Definition: xmc_scu.h:255
void XMC_SCU_INTERRUPT_ClearEventStatus(const XMC_SCU_INTERRUPT_EVENT_t event)
Definition: xmc1_scu.c:397
XMC_SCU_STATUS_t XMC_SCU_INTERRUPT_SetEventHandler(const XMC_SCU_INTERRUPT_EVENT_t event, const XMC_SCU_INTERRUPT_EVENT_HANDLER_t handler)
Definition: xmc1_scu.c:828
#define SCU_RESET_RSTSTAT_RSTSTAT_Msk
Definition: XMC1400.h:4602
#define SCU_RESET
Definition: XMC1400.h:8841
__STATIC_INLINE uint32_t XMC_SCU_RESET_GetDeviceResetReason(void)
Definition: xmc_scu.h:391
void XMC_SCU_CLOCK_Init(const XMC_SCU_CLOCK_CONFIG_t *const config)
Definition: xmc1_scu.c:545
void XMC_SCU_CLOCK_GatePeripheralClock(const XMC_SCU_PERIPHERAL_CLOCK_t peripheral)
Definition: xmc1_scu.c:628
void XMC_SCU_IRQHandler(uint32_t sr_num)
Definition: xmc1_scu.c:859
#define SCU_GENERAL
Definition: XMC1400.h:8837
XMC_SCU_STATUS
Definition: xmc_scu.h:170
__STATIC_INLINE void XMC_SCU_SetCcuTriggerHigh(const uint32_t trigger)
Definition: xmc_scu.h:230
XMC_SCU_INTERRUPT_EVENT_t XMC_SCU_INTERUPT_GetEventStatus(void)
Definition: xmc1_scu.c:385
__STATIC_INLINE uint32_t XMC_SCU_GetMirrorStatus(void)
Definition: xmc_scu.h:543
#define __STATIC_INLINE
Definition: cmsis_gcc.h:47
uint32_t SystemCoreClock
void XMC_SCU_INTERRUPT_EnableEvent(const XMC_SCU_INTERRUPT_EVENT_t event)
Definition: xmc1_scu.c:358